<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="zh-CN">
<head>
    <title>考试系统考生登录</title>
    <th:block th:include="fragment_header :: header">
    </th:block>
</head>

<!--公司颜色   style="background-color: #003366;"-->

<body>
<div class="d-flex align-items-center justify-content-center vh-100">

    <form class="w-25 p-3 " method="post" th:action="@{ /login }" style="background-color: #e3f2fd;">

        <h2>登录</h2>
        <div class="alert alert-warning" role="alert" th:if="${ param.logout }">
            您已经退出了系统。
        </div>
        <div class="alert alert-warning" role="alert"
             th:if="${ param.error } and ${ session.containsKey('SPRING_SECURITY_LAST_EXCEPTION') }">
            用户名或密码错误。
        </div>
        <div class="alert alert-warning" role="alert"
             th:if="${ param.error } and not ${ session.containsKey('SPRING_SECURITY_LAST_EXCEPTION') }"
             th:text="${ session.SPRING_SECURITY_LAST_EXCEPTION.getMessage() }">
            用户名或密码错误。
        </div>

        <div class="mb-6">
            <label for="username" class="form-label">工号</label>
            <input th:value="${ param.username }" type="text" class="form-control" id="username" name="username"
                   placeholder="SONY 员工号" required autofocus>

            <label for="password" class="form-label">密码</label>
            <input type="password" class="form-control" id="password" name="password" required>
        </div>

        <div class="d-flex align-items-center justify-content-center" style="position:relative;top:8px">
            <div class="mb-6">
                <a th:href="@{ ${ #mvc.url('SC#add').build() } }" class="btn btn-primary"
                   style="position:relative;right:20px">注册</a>
            </div>
            <div>

                <button type="submit" class="btn btn-primary" style="position:relative;left:20px">登录</button>

            </div>
        </div>

    </form>

</div>
</body>
</html>